import requests

"""
   上传文件用Post请求，files参数
"""

with open('../files/favicon.ico', 'rb') as f:
    # 读取file
    files = {'files': f.read()}
    # 上传
    response = requests.post('https://httpbin.org/post', files=files)
    print(response.json())
